package _interview75;

/**
 * 392. 判断子序列
 */
public class No392 {
    public boolean isSubsequence(String s, String t) {
        if (s.isEmpty()) return true;
        int n = s.length(), m = t.length();
        int sPointer = 0;
        for (int i = 0; i < m; i++) {
            if (t.charAt(i) == s.charAt(sPointer)) sPointer++;
            if (sPointer == n) return true;
        }
        return false;
    }
}
